import yaml
import os
import configparser

data_address = os.path.join(os.path.dirname(os.path.dirname(__file__)), "data/data.yaml")
ini_address = os.path.join(os.path.dirname(os.path.dirname(__file__)), "config/setting.ini")
file_path = os.path.join(os.path.dirname(os.path.dirname(__file__)), "file/cas.jpg")


class ReadFile:
    def __init__(self):
        self.data_address = data_address
        self.ini_address = ini_address
        self.file_path = file_path

    def read_data(self):
        f = open(self.data_address, mode="r", encoding="utf-8")
        data = yaml.safe_load(f)
        return data

    def read_ini(self):
        config = configparser.ConfigParser()
        config.read(self.ini_address, encoding="utf-8")
        return config

    def read_file(self):
        file = open(self.file_path, 'rb')
        return file


base_data = ReadFile()
